import java.io.*;
import java.util.HashMap;

import org.xml.sax.SAXException;

public class ParseManifestCSV 
{
	private void getProj2PathMap(String srcCSVFile, String dstPath2NameMapFile) 
	throws SAXException, IOException
	{	
		//the proj-path map
		HashMap<String, String> proj2PathMap = new HashMap<String, String>();
		
		  FileInputStream fstream = new FileInputStream(srcCSVFile);
		  // Get the object of DataInputStream
		  DataInputStream in = new DataInputStream(fstream);
		  BufferedReader inBuffer = new BufferedReader(new InputStreamReader(in));
		  
		  String line = null;
		  while((line = inBuffer.readLine()) != null)
		  {
			  String words[] = line.split(",");
			  if (words.length == 2)
			  {
				  proj2PathMap.put(words[0].trim(), words[1].trim());
				  System.out.println(words[0].trim() + " : " + words[1].trim());
			  }
		  }
		  
		  inBuffer.close();
	}
	
	public static void main(String args[]) throws SAXException, IOException
	{
		ParseManifestCSV fuyun = new ParseManifestCSV();
		
		fuyun.getProj2PathMap("data/android-4.0.1/manifest.csv",
				"data/android-4.0.1/projPath2NameMap.csv");
	}
}